#include <stdio.h>
#include <math.h>
int main()
{double a;
 double a0;
 double a1;
 printf("which number you wanna conut its sqrt?:");
 scanf("%lf",&a);
 a0=a/2;   // 初值是谁都不要紧，尽可能靠近就行，减少计算量，迭代法会慢慢收敛到根
 a1=(a0+a/a0)/2;
 do
{
 a0=a1;
 a1=(a0+a/a0)/2;
}while(fabs(a1-a0)>=1e-5);
printf("the sqrt of %lf is %lf",a,a1);
return 0;
}